package com.snpic.appaw.module.insure.dal.mysql.cxImage;

import com.snpic.appaw.framework.common.pojo.PageResult;
import com.snpic.appaw.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.snpic.appaw.framework.mybatis.core.mapper.BaseMapperX;
import com.snpic.appaw.module.insure.dal.dataobject.cxImage.CxImageDO;
import org.apache.ibatis.annotations.Mapper;
import com.snpic.appaw.module.insure.controller.app.cxImage.vo.*;

/**
 * 车险-影像 Mapper
 *
 * @author jijun
 */
@Mapper
public interface CxImageMapper extends BaseMapperX<CxImageDO> {

    default PageResult<CxImageDO> selectPage(AppCxImageDOPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CxImageDO>()
                .eqIfPresent(CxImageDO::getSerNo, reqVO.getSerNo())
                .eqIfPresent(CxImageDO::getCarPlate, reqVO.getCarPlate())
                .likeIfPresent(CxImageDO::getCarOwnerName, reqVO.getCarOwnerName())
                .eqIfPresent(CxImageDO::getCarOwnerIdno, reqVO.getCarOwnerIdno())
                .eqIfPresent(CxImageDO::getCarOwnerPhone, reqVO.getCarOwnerPhone())
                .eqIfPresent(CxImageDO::getRackNo, reqVO.getRackNo())
                .eqIfPresent(CxImageDO::getEngineNo, reqVO.getEngineNo())
                .betweenIfPresent(CxImageDO::getRegisterDate, reqVO.getRegisterDate())
                .eqIfPresent(CxImageDO::getIdCardHeadUrl, reqVO.getIdCardHeadUrl())
                .eqIfPresent(CxImageDO::getIdCardBackUrl, reqVO.getIdCardBackUrl())
                .eqIfPresent(CxImageDO::getVehicleLicenseHeadUrl, reqVO.getVehicleLicenseHeadUrl())
                .eqIfPresent(CxImageDO::getVehicleLicenseBackUrl, reqVO.getVehicleLicenseBackUrl())
                .eqIfPresent(CxImageDO::getNewCarCertificateUrl, reqVO.getNewCarCertificateUrl())
                .eqIfPresent(CxImageDO::getPushFlag, reqVO.getPushFlag())
                .betweenIfPresent(CxImageDO::getPushDate, reqVO.getPushDate())
                .eqIfPresent(CxImageDO::getTradeNo, reqVO.getTradeNo())
                .betweenIfPresent(CxImageDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(CxImageDO::getRemark, reqVO.getRemark())
                .eqIfPresent(CxImageDO::getOldId, reqVO.getOldId())
                .orderByDesc(CxImageDO::getId));
    }

}